Microprocessor with trace module

ABSTRACT

A processor-based device includes a processor, a trace module, a plurality of data input/output pins, and an input/output interface circuit. The input/output interface circuit, when operating in a trace mode, externally outputs trace data signals from the trace module to an external device via at least one of the data input/output pins. When in a normal mode, the input/output interface circuit transfers data from the processor core to the data input/output pins and transfers data received at the data input/output pins to the processor core. In this manner, the processor-based device according to the present invention can output trace data using normal data input/output pins without the need for additional pins for outputting the trace data.

This application is a continuation application of U.S. application Ser.No. 10/412,979, filed on Apr. 14, 2003 now U.S. Pat. No. 7,055,078,which relies for priority upon Korean Patent Application No. 2002-34814,filed on Jun. 21, 2002, the contents of which are herein incorporated byreference in their entirety.

FIELD OF THE INVENTION

The present invention is related to a microprocessor that is capable ofsupporting program trace functionality, and in particular to amicroprocessor having a trace module.

BACKGROUND OF THE INVENTION

Program trace is one of the important debugging tools that are commonlyused by programmers and software engineers. The program trace takes theform of a set of instructions executed by a digital processor. Bydetermining whether certain instructions have been executed, users (forexample, programmers or software engineers) can judge whether thehardware and software have properly executed a process. If abnormaloperation is determined, a user can then discriminate the source of theproblem.

A processor chip such as a microprocessor or microcontroller commonlyincludes a trace module for the purpose of accommodating firmwaredevelopment and debugging. In order to monitor information generated bythe trace module, a trace data output pin is further required inaddition to the standard data input/output pins.

However, the addition of a trace data output pin to a processor chipgives rise to an increase in chip size and cost. Accordingly, it is moreburdensome to manufacture a processor chip in this manner.

SUMMARY OF THE INVENTION

In view of the above limitations of the conventional embodiments, it istherefore an object of the present invention to provide a microprocessorintegrated circuit capable of outputting trace data through normal datainput/output pins of a processor chip.

In accordance with one aspect of the present invention, there isprovided a processor-based device provided with pins that permitconnection to at least one external device. The device includes aprocessor core, a trace module for generating trace data signals, and aplurality of data input/output pins which input and output data from andto the at least one external device. An input/output interface circuit,when operating in a trace mode, externally outputs the trace datasignals from the trace module to the at least one external device via atleast one of the data input/output pins.

The input/output interface circuit, when operating in a normal mode,transfers data from the processor core to the data input/output pins andtransfers data received from the data input/output pins to the processorcore.

The input/output interface circuit includes a serial port which receivesstandardized serial signals, and a controller which generates a modeselect signal and trace output pin select signals in response to theserial signals. The mode select signal indicates whether a currentoperating mode is the trace mode or the normal mode. The trace outputpin select signal is used to select the at least one data input/outputpins that output the trace data signals during trace mode. The traceoutput pin select signals correspond to the plurality of datainput/output pins, respectively.

The trace module activates a trace output enable signal when the modeselect signal indicates that the current operating mode is the tracemode. The input/output interface circuit further includes a plurality oflogic circuits corresponding to the trace output pin select signalsrespectively. Each of the input/output interface circuits selects one offirst and second trace data signals from the trace module and transfersthe selected one of the first and second trace data signals to acorresponding data input/output pin when a corresponding trace outputpin select signal and the corresponding trace output enable signal areactivated.

In a preferred embodiment, the serial port is essentially compliant withthe IEEE-1149.1-1990 JTAG interface standard or other similar standard.

The processor core generates an output enable signal, and theinput/output interface circuit transfers data from the processor core tothe data input/output pins when the mode select signal indicates thatthe current operating mode is the normal mode and the output enablesignal is activated. The input/output interface circuit transfers datareceived from the data input/output pins to the processor core when themode select signal indicates that the current operating mode is thenormal mode and the output enable signal is inactivated.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete appreciation of the present invention, and many of theattendant advantages thereof, will become readily apparent as the samebecomes better understood by reference to the following detaileddescription when considered in conjunction with the accompanyingdrawings in which like reference symbols indicate the same or similarcomponents, wherein:

FIG. 1 is a block diagram of a target system according to the presentinvention; and

FIG. 2 is a preferred embodiment of an input/output interface circuit ofan embedded processor device for the target system illustrated in FIG.1.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

The preferred embodiment of the invention will now be more fullydescribed with reference to the attached drawings.

FIG. 1 schematically depicts a target system according to the presentinvention. Referring to FIG. 1, a target system 10 according to thepresent invention includes an embedded processor device 200 coupled to asystem memory 100. The embedded processor device 200 incorporates aprocessor core 210, a trace module 220, and an input/output interfacecircuit 230. Although not considered critical to the present invention,the embedded processor device 200 may incorporate additional circuitry(not shown) for performing application specific functions, or,optionally, may take the form of a stand-alone processor or digitalsignal processor (DSP).

A host system 20 is used- to execute debug control software 21 fortransferring high-level commands and for controlling the extraction andanalysis of debug information generated by the target system 10. Thehost system 20 and the target system 10 of the disclosed embodiment ofthe invention communicate, for example, via a serial link 30.

FIG. 2 is a preferred embodiment of an input/output interface circuit230 of the embedded processor device 200 illustrated in FIG. 1.Referring to FIG. 2, an input/output interface circuit 230 includes aTAP (Test Access Port) controller 231 coupled with a JTAG (Joint TestAction Group) port 250, a register 232, and logic circuits 310-340connected respectively to data input/output pins 241-244. In thisembodiment, the embedded processor device 200 has four data input/outputpins 241-244. It would be apparent to those skilled in the art that thenumber of data input/output pins can be modified according to circuitspecifications.

The JTAG port 250 uses an IEEE-1149.1-1990 compliant JTAG interface orother similar standardized serial port interfaces.

The TAP controller 231 generates a mode select signal MODE in responseto an input of the JTAG port 250. The mode select signal MODE indicateswhether the current operating mode is a normal mode or a trace mode. Atrace module 220 activates a trace output enable (TOE) signal at a highlevel when the mode select signal MODE indicates that trace, mode isoperational. The trace module 220 inactivates the trace output enableTOE signal at a low level when the mode select signal MODE indicatesthat normal mode is operational. The TAP controller 231 generates selectsignals TP1-TP4 in response to an input of the JTAG port 250. The selectsignals TP1-TP4 are used to select which pins, for example two pins, ofthe data input/output pins, at which trace data TD1 and TD2 from thetrace module 220 are to be output. The select signals TP1-TP4 from theTAP controller 231 are stored in the register 232.

In the embodiment illustrated, the trace module 220 outputs two tracedata bits TD1 and TD2. It would however be apparent to those skilled inthe art that the number of trace data bits from the trace module 220 maybe modified according to circuit specifications. For the case wheretrace data is formed of two bits and the number of data input/outputpins is 4, the select signals TP1-TP4 are used to select two datainput/output pins from the four available pins for outputting the tracedata bits TD1 and TD2.

The logic circuit 310 incorporates AND gates 311, 313 and 318, an ORgate 314, inverters (or buffers) 316 and 317, and multiplexers 312 and315. Each of the AND gates 313 and 318 has an inverting input terminaland a non-inverting input terminal. The AND gate 311 receives the traceoutput enable signal TOE from the trace module 220 and the select signalTP1 from the register 232. The multiplexer 312 receives the trace datasignals TD1 and TD2 and outputs one of the received signals in responseto a select signal S1 from the trace module 220. The AND gate 313receives an output enable signal OE via its non-inverting input terminaland an output signal of the AND gate 311 via its inverting inputterminal. The OR gate 314 receives output signals of gates 311 and 313.The multiplexer 315 receives an output data signal DOUT1 from theprocessor 210 and an output signal of the multiplexer 312, and selectsone of the received signals in response to an output signal of the ANDgate 311. An output signal of the multiplexer 315 is transferred to thedata input/output pin 241 via the inverter 316. The inverter 316 iscontrolled by an output signal of the OR gate 314. For example, when theoutput signal of the OR gate 314 is activated, the inverter 316 isactivated to form its transfer path. When the output signal of the ORgate 314 is inactivated, the inverter 316 is inactivated to cut off itstransfer path. An input signal received via the pin 241 is transferredto a non-inverting input terminal of the AND gate 318. An output signalof the AND gate 311 is provided to an inverting input terminal of theAND gate 318. An output signal DIN1 of the AND gate 318 is transferredto the processor 210.

Remaining logic circuits 320-340 are configured the same as the logiccircuit 310. Constituent elements in the respective logic circuits320-340 are marked by the same or similar reference numerals and symbolsas or to those of the logic circuit 310. Description thereof will bethus omitted for the sake of brevity.

The operation of the processor device 200 according to a preferredembodiment of the present invention will be described below.

To begin with, during a normal mode of operation, the mode select signalMODE becomes low such that output data bits DOUT1-DOUT4 from theprocessor 210 are transmitted to the external via data input/output pins241-244. A trace module 220 inactivates the trace output enable signalTOE to a low level in response to the mode select signal MODE being at alow level. Meanwhile, during the normal mode of operation, the processor210 activates an output enable signal OE to a high level, in order toexternally output the output data bits DOUT1-DOUT4. Under these, theoutput signal of the AND gate 311 becomes low and the output signal ofthe AND gate 313 becomes high. Multiplexer 315 outputs a data signalDOUT1 generated by the processor 210 in response to the low-level signaloutput of the AND gate 311. Since the output signal of the AND gate 313is at a high level, an OR gate 314 outputs a high-level signal. When theoutput signal of the OR gate 314 has a low-to-high transition, theoutput signal of the multiplexer 315, that is, the data bit DOUT1 fromthe processor 210 is transferred to the data input/output pin 241 viathe inverter 316.

When the signals OE and TOE are both at a low level, data received viathe pin 241 is provided to the processor 210 via a data input path, thatis, via the inverter 317 and the AND gate 318. Logic circuits 320-340connected to remaining pins 242-244 operate the same as the logiccircuit 310, and description thereof will be thus omitted.

Meanwhile, during trace mode, the mode select signal MODE goes high forexternally outputting trace data TD1 and TD2 via selected datainput/output pins 241-244. The trace module 220 activates the traceoutput enable signal TOE to a high level in response to the mode selectsignal MODE being at a high level. At this time, the output enablesignal OE from the processor 210 is inactivated to a low level.

It is assumed in this example that select signals TP1-TP4 in theregister 232 have values of ‘1’, ‘1’, ‘0’ and ‘0’ respectively, and thatselect signals S1-S4 from the trace module 220 have ‘0’, ‘1’, ‘x’ and‘x’ values respectively. The symbol ‘x’ indicates the “don't care”state.

The multiplexer 312 selects one (e.g., TD1) of trace data bits TD1 andTD2 in response to the select signal S1. Since the trace output enablesignal TOE and the select signal TP1 both have a high level, the outputsignal of the AND gate 311 becomes high. At this time, since the OR gate314 outputs a high-level signal, the multiplexer 315 selects for outputthe output of multiplexer 312, that is, the trace data TD1 from thetrace module 220. The output signal of the multiplexer 315 istransferred to the data input/output pin 241 via the inverter 316, whichis activated by a high-level signal from the OR gate 314. That is,during the trace mode, the trace data TD1 is output via the datainput/output pin 241 as a normal data input/output pin of the processordevice 200.

In a similar manner, the trace data TD2 from the trace module 220 can beexternally output to a data input/output pin, for example pin 242,through the logic circuit 320.

Namely, when the trace output enable signal TOE is activated to a highlevel under the aforementioned assumption, the trace data bits TD1 andTD2 are externally output through normal data input/output pins 241 and242. As described above, it is assumed that select signals TP1-TP4 inthe register 232 have ‘1’, ‘1’, ‘0’ and ‘0’ values respectively andselect signals S1-S4 from the trace module 220 have ‘0’, ‘1’, ‘x’ and‘x’ values respectively. In order to output the data bits TD1 and TD2via data input/output pins 243 and 244, the select signals TP1-TP4 areset to ‘0’, ‘0’, ‘1’ and ‘1’ respectively and the select signals S1-S4are set to ‘x’, ‘x’, ‘0’, and ‘1’ respectively. Accordingly, trace datafrom the trace module 220 can be output through two pins of the datainput/output pins 241-244 of the processor device 200.

In accordance with the present invention, trace data is output usingnormal data input/output pins of a processor device rather thantrace-dedicated pins. This means that additional pins for outputting thetrace data are not required. Accordingly, the present invention preventsan increase in the chip size and an increase in the cost involved inproviding additional pins for the trace data.

While this invention has been particularly shown and described withreferences to preferred embodiments thereof, it will be understood bythose skilled in the art that various changes in form and details may bemade herein without departing from the spirit and scope of the inventionas defined by the appended claims.

1. A semiconductor device including pins that permit connection to atleast one external device, comprising: an internal core that receivesand generates data signals; a trace module that generates trace datasignals; a plurality of data input/output pins which, when thesemiconductor device is operating in a normal mode, input and output thedata signals from and to the at least one external device; and aplurality of logic circuits, each corresponding to one of the pluralityof data input/output pins, and each, when the semiconductor device isoperating in a trace mode, externally outputs one of the trace datasignals from the trace module to the at least one external device viathe corresponding one of the plurality of data input/output pins inresponse to a plurality of trace output pin select signals.
 2. Thesemiconductor device of claim 1, further comprising: a serial port whichreceives standardized serial signals; and a test access port (TAP)controller which generates a mode select signal and the plurality oftrace output pin select signals in response to the serial signalsreceived at the serial port, wherein the mode select signal indicateswhether a current operating mode of the device is the trace mode or thenormal mode.
 3. The semiconductor device of claim 2, wherein the tracemodule activates a trace output enable signal when the mode selectsignal indicates that the current operating mode is the trace mode. 4.The semiconductor device of claim 3, wherein each of plurality of logiccircuits selects one of the trace data signals from the trace module andtransfers the selected one of the trace data signals to a correspondingdata input/output pin when the corresponding trace output pin selectsignal and the corresponding trace output enable signal are activated.5. The semiconductor device of claim 2, wherein the serial port isessentially compliant with the IEEE-1149.1-1990 JTAG interface standardor other similar standard.
 6. The semiconductor device of claim 1,wherein the plurality of logic circuits, when the semiconductor deviceis operating in the normal mode, transfer data from the internal core tothe plurality of data input/output pins and transfer data received atthe data input/output pins to the internal core.
 7. The semiconductordevice of claim 1, wherein the internal core generates an output enablesignal, and wherein the plurality of logic circuits each transfer datafrom the internal core to the corresponding data input/output pin whenthe mode select signal indicates that the current operating mode is thenormal mode and when the output enable signal is activated.
 8. Thesemiconductor device of claim 7, wherein the plurality of logic circuitseach transfer data received from the data input/output pins to theinternal core when the mode select signal indicates that the currentoperating mode is the normal mode and when the output enable signal isinactivated.
 9. A method of operating a semiconductor device includingpins that permit connection to at least one external device, comprising:receiving and generating data signals at an internal core; generatingtrace data signals at a trace module; inputting and outputting the datasignals from and to the at least one external device at a plurality ofdata input/output pins when the semiconductor device is operating in anormal mode; and externally outputting one of the trace data signalsfrom the trace module to the at least one external device via thecorresponding one of the plurality of data input/output pins in responseto a plurality of trace output pin select signals at a plurality oflogic circuits, each logic circuit corresponding to one of the pluralityof data input/output pins, when the semiconductor device is operating ina trace mode.
 10. The method of claim 9, further comprising: receivingstandardized serial signals at a serial port; and generating a modeselect signal and the plurality of trace output pin select signals at atest access port (TAP) controller in response to the serial signalsreceived at the serial port, wherein the mode select signal indicateswhether a current operating mode of the device is the trace mode or thenormal mode.
 11. The method of claim 10, wherein the plurality of logiccircuits, when the semiconductor device is operating in the normal mode,transfer data from the internal core to the plurality of datainput/output pins and transfer data received at the data input/outputpins to the internal core.
 12. The method of claim 10, wherein the tracemodule activates a trace output enable signal when the mode selectsignal indicates that the current operating mode is the trace mode. 13.The method of claim 12, wherein each of the plurality of logic circuitsselects one of the trace data signals from the trace module andtransfers the selected one of the trace data signals to a correspondingdata input/output pin when the corresponding trace output pin selectsignal and the corresponding trace output enable signal are activated.14. The method of claim 10, wherein the serial port is essentiallycompliant with the IEEE-1149.1-1990 JTAG interface standard or othersimilar standard.
 15. The method of claim 10, wherein the internal coregenerates an output enable signal, and wherein the plurality of logiccircuits each transfer data from the internal core to the correspondingdata input/output pin when the mode select signal indicates that thecurrent operating mode is the normal mode and when the output enablesignal is activated.
 16. The method of claim 15, wherein the pluralityof logic circuits each transfer data received from the data input/outputpins to the internal core when the mode select signal indicates that thecurrent operating mode is the normal mode and when the output enablesignal is inactivated.